<%
	// Check Login privilege
	Account account = (Account) session.getAttribute("account");
	if(account == null){
	    response.sendRedirect("${pageContext.request.contextPath}/CheckPrivilegeServlet");
	}else{
	    if(account.getPrivilege() != Privilege.MANAGE_SERVICE){%>
	    	<jsp:include page="error.jsp"></jsp:include>
   		<%}else{
%>
<title>My Profile</title>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="common.Privilege"%>
<%@page import="model.bean.Account"%>
<jsp:include page="common/header.jsp"></jsp:include>
<style type="text/css">
.form-control {
	width: 50%;
	margin: 0 auto;
	
}
</style>
<div id="page-wrapper" >
	<form action = "${pageContext.request.contextPath}/AccountSettingServlet?action=updateInfo" method="post">
		<div class="panel panel-default" style = "background: none;">
		<div class="panel-heading">Thông tin cá nhân</div>
		<center><h3 style="color: red;">${errMessage}</h3></center>
			<div class="panel-body" style = "padding-left: 20%;" >
				<div class="form-group">
					<label>Tên tài khoản: </label>
					<label class="form-control"><%= account.getNameAccount() %></label>
				</div>
				<div class="form-group">
					<label>Chức vụ: </label> 
					<label class="form-control"><%= account.getDesAccount() %></label>
				</div>
				<fieldset>
					<legend>Thông tin cá nhân:</legend>
					<div class="form-group">
						<label>Họ và tên: </label> <input name = "fullName" id = "fullName" class="form-control" type="text"
							required="required" value="<%= account.getName()  %>">
					</div>
					<div class="form-group">
						<label>Giới tính: </label>
						<select class="form-control" name = "gender" id = "gender">
							<option value="false" <% if (account.isSex()) out.print("selected"); %> >Nữ</option>
							<option value="true" <% if (account.isSex()) out.print("selected"); %> >Nam</option>
						</select>
					</div>
					<div class="form-group">
						<label>Email: </label> <input name = "email" id = "email" class="form-control" type="text" value="<%= account.getEmail()  %>">
					</div>
					<div class="form-group">
						<label>Phone: </label> <input name = "phone" id = "phone" class="form-control" type="text" value="<%= account.getPhoneNumber() %>">
					</div>
					<div class="form-group">
						<label>Ngày sinh: </label> <input name = "dob" id = "dob" class="form-control" type="date" value="<%= account.getDateOfBirth() %>">
					</div>
					<div class="form-group">
						<label>Ảnh đại diện: </label> <input class="form-control"	type="file">
					</div>
				</fieldset>
				<div style="float: right; margin-right: 100px;">
					<button type="submit" class="btn btn-success btn-sm">Cập nhập</button>
					<a type="button" href="changepass.jsp" class="btn btn-success btn-sm">Thay đổi mật khẩu</a>
				</div>
			</div>
		</div>
	</form>
</div> <!-- /. PAGE WRAPPER  -->
<jsp:include page="common/footer.jsp"></jsp:include>
<% }} %>